import fetch from '../model/fetch';
import maindetail from "../view/maindetail.html";

export default class DetailController {
    constructor() {
        this.initEvent();
    }

    load() {
        window.location.href = "../detail.html";
        // console.log(id)
    }
    async render() {

        let list = await new fetch().getPositionDetail();
        let detailstr = template.render(maindetail, { detail: list.details })
        // console.log(detailstr)
        // console.log($(".detail-main"));
        $(".detail-main").html(detailstr);
    }
    initEvent() {
        $("#back").on('click', function () {
            history.back(-1);
        })
        $("#home").on('click', function () {
            window.location.href = "http://localhost:8000/#position";
        })
    }
}